package com.qitmiaojie.mapper;

import com.qitmiaojie.pojo.Leave;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qitmiaojie.pojo.dto.Examine;
import com.qitmiaojie.pojo.dto.LeaveRecord;
import com.qitmiaojie.pojo.geography.Feature;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @Entity com.qitmiaojie.pojo.Leave
 */
@Mapper
public interface LeaveMapper extends BaseMapper<Leave> {


    List<LeaveRecord> selectByPage(@Param("name") String name,
                                   @Param("id") String id,
                                   @Param("examine")  String examine,
                                   @Param("start") int start,  @Param("end") int end);

    Integer insertExamine(Examine examine);

    Integer AddFeature(Map<String, Object> map);

    Integer FindAllLeaveRecordCount(Map<String, Object> map);

    List<LeaveRecord> selectLeaveRecordAll();
    @Select("select count(student_id) from `leaves` where enddate >= #{timestart} and enddate <= #{timeend} and enddate like #{today} and examine ='已审批' ")
    Integer FindDayTimeIn(String timestart, String timeend, String today);
    @Select("select count(student_id) from `leaves` where startdate >= #{timestart} and startdate < #{timeend} and examine ='已审批'")
    Integer FindDayTimeOut(String timestart, String timeend, String today);

    List<Feature> selectAllFeature();

    List<String> selectAllCoordinates();

/*    @Select("select * from student,leaves where ")
    LeaveRecord selectLeaveRecordById(Integer id);*/
}




